<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\PlatIncomeLogRepository")
 */
class PlatIncomeLog
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="float")
     */
    private $money;

    /**
     * @ORM\Column(type="datetime")
     */
    private $createAt;

    /**
     * 这里可以记录一些内容
     * 订单编号：orderId=>ID ，此时tips字段存储订单编号，用于联合查询
     * @ORM\Column(type="array", nullable=true)
     */
    private $param = [];

    /**
     * 收入类型
     * 平台盈利收益：1
     * 奖金池收入：2
     * 地区代理收入：3
     * @ORM\Column(type="string", length=32, nullable=true)
     */
    private $flag;

    /**
     * 记录说明字段
     * 或者一些额外参数
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $tips;

    /**
     * @ORM\Column(type="string", length=32, nullable=true)
     */
    private $province;

    /**
     * @ORM\Column(type="string", length=32, nullable=true)
     */
    private $city;

    /**
     * @ORM\Column(type="string", length=32, nullable=true)
     */
    private $area;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getMoney(): ?float
    {
        return $this->money;
    }

    public function setMoney(float $money): self
    {
        $this->money = $money;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeInterface
    {
        return $this->createAt;
    }

    public function setCreateAt(\DateTimeInterface $createAt): self
    {
        $this->createAt = $createAt;

        return $this;
    }

    public function getParam(): ?array
    {
        return $this->param;
    }

    public function setParam(?array $param): self
    {
        $this->param = $param;

        return $this;
    }

    public function getFlag(): ?string
    {
        return $this->flag;
    }

    public function setFlag(?string $flag): self
    {
        $this->flag = $flag;

        return $this;
    }

    public function getTips(): ?string
    {
        return $this->tips;
    }

    public function setTips(?string $tips): self
    {
        $this->tips = $tips;

        return $this;
    }

    public function getProvince(): ?string
    {
        return $this->province;
    }

    public function setProvince(?string $province): self
    {
        $this->province = $province;

        return $this;
    }

    public function getCity(): ?string
    {
        return $this->city;
    }

    public function setCity(?string $city): self
    {
        $this->city = $city;

        return $this;
    }

    public function getArea(): ?string
    {
        return $this->area;
    }

    public function setArea(?string $area): self
    {
        $this->area = $area;

        return $this;
    }
}
